home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 November
/
Pcwk1197.iso
/
LOTUS
/
Eng-ins
/
SAMPLES
/
SUITE
/
DW08_S4.APR
/
SCRIPT
/
ApproachDoc
/
Blank Database
/
Body
/
btnEnterComment.s
(
.txt
)
< prev
next >
Wrap
Null Bytes Alternating
|
1996-10-27
|
4KB
|
63 lines
'++LotusScript Development Environment:2:5:(Options):0:66
'++LotusScript Development Environment:2:5:(Forward):0:1
Declare Sub Click(Source As Button, X As Long, Y As Long, _
Flags As Long)
'++LotusScript Development Environment:2:5:(Declarations):0:2
'++LotusScript Development Environment:2:2:BindEvents:1:129
Private Sub BindEvents(Byval Objectname_ As String)
Static Source As BUTTON
Set Source = Bind(Objectname_)
On Event Click From Source Call Click
End Sub
'++LotusScript Development Environment:2:2:Click:2:12
Sub Click(Source As Button, X As Long, Y As Long, _
Flags As Long)
'Click event for the btnEnterComment button object.
'Prompts the user for input, appends today's date to the
'user's comment, and appends the comment to each
'record in the found set.
' * RUNTIME DEPENDENCIES
' * Files: This script requires a field named "Notes".
'Create a DocWindow object.
Dim MyDocWin As DocWindow
'Retrieve the active DocWindow.
Set MyDocWin = CurrentApplication.ActiveDocWindow
Dim UserInput As String 'Store user's input
Dim NoteEntry As String 'Store the input with today's date
Dim PreviousEntries As String 'Store existing contents of Note
Dim WholeNote As String 'Store all the Note contents
Dim I As Integer 'Index of found set
'Get input from user.
UserInput = Inputbox$("Enter your comments", , ,300,300)
'Check that the user entered a comment.
If UserInput <> "" Then
'Append today's date to the user's input.
NoteEntry = Date$ & ": " & UserInput
'Loop through each record in the found set and
'update the Note field.
MyDocWin.FirstRecord 'Go to first record.
'Loop through the number of records in the found set
For I = 1 To MyDocWin.NumRecordsFound
'Store the existing contents of the Note field.
PreviousEntries = Source.Note.Text
'Append the new entry to the existing ones.
WholeNote = PreviousEntries & " " & NoteEntry & "."
'Insert the new Note in the field.
Source.Note.Text = WholeNote
'Go to the next record in the found set.
MyDocWin.NextRecord
Next 'Record in the found set
End If 'If the user entered a comment
End Sub 'Click event for btnEnterComment